Use AspectGen
Go
SELECT     WEM.LocationID AS EventLOCID, WCM.LocationID AS ComLocID, WCM.CompanyName, WS.SourceName, LB.CountryCode, LB.CountryName
FROM         tblWebEventCustLink AS WEC INNER JOIN
                      tblWebCustomer AS WC ON WEC.CustID = WC.CustID INNER JOIN
                      tblWebEventMaster AS WEM ON WEC.EventID = WEM.EventID INNER JOIN
                      tblWebCompanyMaster AS WCM ON WC.CompanyID = WCM.CompanyID INNER JOIN
                      tblWebSource AS WS ON WC.SourceID = WS.SourceID INNER JOIN
                      tblLocationBase AS LB ON WCM.LocationID = LB.LocationID INNER JOIN
                      tblComboItem AS CB ON ISNULL(WC.CustType, '0') = CB.CIComboTextShort AND CB.CIComboID = 1102
GROUP BY WCM.LocationID, WEM.LocationID, WCM.CompanyName, WS.SourceName, LB.CountryCode, LB.CountryName
--HAVING      (WS.SourceName = N'ASPECT') AND
--(WEM.LocationID in (select LocationID From dbo.tblLocationBaseCampaign Where LocAccessID = 90)) 
--			And WCM.LocationID In (select LocationID from tblLocationBaseCampaign bc where bc.LocAccessID = 90)

HAVING      (WS.SourceName = N'ASPECT') AND
(WEM.LocationID = 1) 
			And WCM.LocationID In (select LocationID from tblLocationBaseCampaign bc where bc.LocAccessID = 90)


select DISTINCT cm.CompanyName, cm.CompanyID, lb.CountryName, s.SourceName from tblWebCompanyMaster cm 
                inner join tblWebCustomer c on c.CompanyID = cm.CompanyID
                inner join tblWebSource s on s.SourceID = c.SourceID
                inner join tblLocationBase lb on lb.LocationID = cm.LocationID
                inner join tblComboItem ci on IsNull(c.CustType, '0') = ci.CIComboTextShort and ci.CIComboID = 1102
                where c.IsActive = 1 and lb.LocationID IN (select LocationID from tblLocationBaseCampaign bc 
where bc.LocAccessID = 90) and cm.IsActive = 1 


select DISTINCT cm.CompanyName, cm.CompanyID, lb.CountryName, s.SourceName from tblWebCompanyMaster cm 
                inner join tblWebCustomer c on c.CompanyID = cm.CompanyID
                inner join tblWebSource s on s.SourceID = c.SourceID
                inner join tblLocationBase lb on lb.LocationID = cm.LocationID
                inner join tblComboItem ci on IsNull(c.CustType, '0') = ci.CIComboTextShort and ci.CIComboID = 1102
                where c.IsActive = 1 and lb.LocationID IN (select LocationID from tblLocationBaseCampaign bc 
where bc.LocAccessID = 90) and cm.IsActive = 1  and lb.LocationID = 1 


select top 100 * from tblWebCustomer

select top 100 * from tblDistributorContact

select top 100 * from tblWebEventMaster

select top 100 * from tblWebEventCustLink

select top 100 * from tblWebCompanyMaster

--Load Event
select distinct ecl.EventID, em.EventName from tblWebEventCustLink ecl
                inner join tblWebEventMaster em on em.EventID = ecl.EventID
                where em.LocationID IN (select LocationID from tblLocationBaseCampaign bc where bc.LocAccessID = '') 
                order by em.EventName